<?php

require_once "html/spDiv.php";

class spGuiMappingText extends spDiv
{
	private $name;

	public function __construct( $param )
	{
		parent::__construct();
		
		$this->name = $param["name"];
		
		if ( isset($param["list"]) )
			$this->addList( $param["list"] );
	}
	
	public function addList( $list )
	{
		foreach ( $list as $k => $v )
		{
			$ta0 = new spTextArea(array(
				"name" => $this->name."[]"
			));
			$ta0->addStyle( "resize", "none" );
			$ta0->setReadOnly( true );
			$ta0->setContent( $k );
			parent::addChild( $ta0 );
			
			$ta1 = new spTextArea(array(
				"name" => $this->name."[]"
			));
			$ta1->addStyle( "resize", "none" );
			$ta1->setContent( $v );
			parent::addChild( $ta1 );
			
			parent::addChild( new spBreak );
			
			
		}
	}


	
}

?>